<template>
		
	<view>
		<view>
			<button size="mini" @click="chooseImg">上传图片</button>
			<image :src="item" v-for="(item,index) in img" :key="index" @click="previewImage(item)"/>
		</view>
		<view>
			 <!-- #ifdef APP -->
			<text>我是APP</text>
			<!-- #endif -->
			<!-- #ifdef MP-WEIXIN -->
			<text>
				我是小程序
			</text>
			<!-- #endif -->
		</view>
		<navigator url="/pages/leave/leave?id=12&message=你好">
			<button type="default" size="mini">navigator</button>
		</navigator>
		<button size="mini" @click="navigate1To">navigate</button>
	</view>
</template>

<script>
	import {doNavigatePage} from '@/js/navigatePage'
	export default {
		data() {
			return {
				img: []
			}
		},
		methods: {
			chooseImg(){
				uni.chooseImage({
					count:5,
					sizeType:['original','compressed'],
					success:res=>{
						console.log(res)
						this.img = res.tempFilePaths
					}
				})
			},
			previewImage(current){
				uni.previewImage({
					current,
					urls:this.img
				})
			},
			navigate1To(){
				doNavigatePage()
			}
		},
		onLoad() {
			//  #ifdef H5
			console.log('我是H5')
			// #endif
			// #ifdef MP-WEIXIN
			console.log('我是微信小程序')
			// #endif
			
			
		}
	}
</script>

<style>

</style>
